<?php

namespace Api;
use News, Response;

class NewsController extends \BaseController {

	/**
	 * Display a listing of news
	 *
	 * @return Response
	 */
	public function index()
	{
        $news = News::whereStatus(1)->get(['id', 'title', 'intro', 'thumbnail', 'created_at'])->toArray();

        return Response::json(['data' => $news], 200);
	}

	/**
	 * Display the specified news.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		$news = News::findOrFail($id);

		return $news;
	}

}
